import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import classify from '@/components/classify'
import information from '@/components/information'
import nearby from '@/components/nearby'
import mine from '@/components/mine'
import order_center from '@/components/order_center'
import favorite from '@/components/favorite'
import set from '@/components/set'
import address from '@/components/address'
import address_jia from '@/components/address_jia'
import set_phone from '@/components/set_phone'
import setpwd from '@/components/setpwd'
import inform from '@/components/inform'
import bankcar from '@/components/bankcar'
import addcar from '@/components/addcar'
import remove from '@/components/remove'
import subordinate from '@/components/subordinate'
import identification from '@/components/identification'
import newlist from '@/components/newlist'
import product0 from '@/components/product0'
import product from '@/components/product'
import product1 from '@/components/product1'
import product2 from '@/components/product2'
import particulars from '@/components/particulars'
import store from '@/components/store'
import nearsto from '@/components/nearsto'
import account from '@/components/account'
import train from '@/components/train'
import banktransfer from '@/components/banktransfer'
import vip from '@/components/vip'
import personal from '@/components/personal'
import phone_approve from '@/components/phone_approve'
import resubmit from '@/components/resubmit'
import edit from '@/components/edit'
import branch from '@/components/branch'
import hangtag from '@/components/hangtag'
import ChangePassword from '@/components/ChangePassword'
import shoppcart from '@/components/shoppcart'
import shopaccounts from '@/components/shopaccounts'
import Table_for from '@/components/Table_for'
import debenture from '@/components/debenture'
import detail from '@/components/detail'
import sell from '@/components/sell'
import Listing from '@/components/Listing'
import entrust from '@/components/entrust'
import donation from '@/components/donation'
import solution from '@/components/solution'
import Pokemon from '@/components/Pokemon'
import message from '@/components/message'
import consume from '@/components/consume'
import refund from '@/components/refund'
import put_in from '@/components/put_in'
import bindingcar from '@/components/bindingcar'
import logistics from '@/components/logistics'
import welfare from '@/components/welfare'
import shingle from '@/components/shingle'
import records from '@/components/records'
import Table_fortwo from '@/components/Table_fortwo'
import Table_forthree from '@/components/Table_forthree'
import aptitude from '@/components/aptitude'
import audit from '@/components/audit'
import login from '@/components/login'
import registered from '@/components/registered'
import registered1 from '@/components/registered1'
import zaohui from '@/components/zaohui'
import toPay from '@/components/toPay'
import productAll from '@/components/productAll'
import product3 from '@/components/product3'
import set_phonenew from '@/components/set_phonenew'
import editBj from '@/components/editBj'
import order_11 from '@/components/order_11'
import appdown from '@/components/appdown'
import lianxi from '@/components/lianxi'

import shopaccountsCar from '@/components/shopaccountsCar'
import sweepPay from '@/components/sweepPay'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/login',
            name: 'login',
            meta: {
                title: '用户登录'
            },
            component: login
        },
        {
            path: '/lianxi',
            name: 'lianxi',
            meta: {
                title: '联系我们'
            },
            component: lianxi
        },
        {
            path: '/',
            name: 'index',
            component: index,
            meta: {
                title: '首页',
                keepAlive: true
            },
        },
        {
            path: '/registered',
            name: 'registered',
            meta: {
                title: '用户注册'
            },
            component: registered
        },
        {
            path: '/registered1',
            name: 'registered1',
            meta: {
                title: '用户注册1'
            },
            component: registered1
        },
        {
            path: "/classify",
            name: "classify",
            component: classify,
            meta: {
                title: '分类',
                keepAlive: true
            },
        },
        {
            path: "/information",
            name: "information",
            component: information,
            meta: {
                title: '资讯',
            },
        },
        {
            path: "/nearby",
            name: "nearby",
            component: nearby,
            meta: {
                title: '附近',
                keepAlive: true
            },
        },
        {
            path: "/mine",
            name: "mine",
            meta: {
                title: '用户中心',
            },
            component: mine
        },
        {
            path: "/order_center",
            name: "order_center",
            component: order_center
        },
        {
            path: "/favorite",
            name: "favorite",
            component: favorite
        },
        {
            path: "/set",
            name: "set",
            component: set
        },
        {
            path: "/address",
            name: "address",
            component: address
        },
        {
            path: "/address_jia",
            name: "address_jia",
            component: address_jia
        },
        {
            path: "/set_phone",
            name: "set_phone",
            component: set_phone
        },
        {
            path: "/setpwd",
            name: "setpwd",
            component: setpwd
        },
        {
            path: "/inform",
            name: "inform",
            component: inform

        },
        {
            path: "/bankcar",
            name: "bankcar",
            component: bankcar
        },
        {
            path: "/addcar",
            name: "addcar",
            component: addcar
        },
        {
            path: "/remove",
            name: "remove",
            component: remove
        },
        {
            path: "/subordinate",
            name: "subordinate",
            component: subordinate
        },
        {
            path: "/identification",
            name: "identification",
            component: identification
        },{
            path: "/order_11",
            name: "order_11",
            component: order_11
        },
        {
            path: "/newlist",
            name: "newlist",
            component: newlist
        },
        {
            path: "/product",
            name: "product",
            component: product,
            meta: {},
        },
        {
            path: "/product0",
            name: "product0",
            component: product0,
            meta: {},
        },
        {
            path: "/product1",
            name: "product1",
            component: product1,

        },
        {
            path: "/product2",
            name: "product2",
            component: product2,
            meta: {},
        },
        {
            path: "/particulars",
            name: "particulars",
            component: particulars
        },
        {
            path: "/store",
            name: "store",
            component: store
        },
        {
            path: "/nearsto",
            name: "nearsto",
            component: nearsto
        },
        {
            path: "/account",
            name: "account",
            component: account
        },
        {
            path: "/train",
            name: "train",
            component: train
        },
        {
            path: "/banktransfer",
            name: "banktransfer",
            component: banktransfer
        },
        {
            path: "/vip",
            name: "vip",
            component: vip
        },
        {
            path: "/personal",
            name: "personal",
            component: personal
        },
        {
            path: "/phone_approve",
            name: "phone_approve",
            component: phone_approve
        },
        {
            path: "/resubmit",
            name: "resubmit",
            component: resubmit
        },
        {
            path: "/edit",
            name: "edit",
            component: edit
        },
        {
            path: "/branch",
            name: "branch",
            component: branch
        },
        {
            path: "/hangtag",
            name: "hangtag",
            component: hangtag
        },
        {
            path: "/ChangePassword",
            name: "ChangePassword",
            component: ChangePassword
        },
        {
            path: "/shoppcart",
            name: "shoppcart",
            component: shoppcart
        },
        {
            path: "/shopaccounts",
            name: "shopaccounts",
            component: shopaccounts
        },
        {
            path: "/Table_for",
            name: "Table_for",
            component: Table_for
        },
        {
            path: "/debenture",
            name: "debenture",
            component: debenture
        },
        {
            path: "/detail",
            name: "detail",
            component: detail
        },
        {
            path: "/sell",
            name: "sell",
            component: sell
        },{
            path: "/appdown",
            name: "appdown",
            component: appdown
        },
        {
            path: "/Listing",
            name: "Listing",
            component: Listing
        },
        {
            path: "/entrust",
            name: "entrust",
            component: entrust
        },
        {
            path: "/donation",
            name: "donation",
            component: donation
        },
        {
            path: "/solution",
            name: "solution",
            component: solution
        },
        {
            path: "/Pokemon",
            name: "Pokemon",
            component: Pokemon
        },
        {
            path: "/message",
            name: "message",
            component: message
        },
        {
            path: "/consume",
            name: "consume",
            component: consume
        },
        {
            path: "/refund",
            name: "refund",
            component: refund
        },
        {
            path: "/put_in",
            name: "put_in",
            component: put_in
        },
        {
            path: "/bindingcar",
            name: "bindingcar",
            component: bindingcar
        },
        {
            path: "/logistics",
            name: "logistics",
            component: logistics
        },
        {
            path: "/welfare",
            name: "welfare",
            component: welfare
        },
        {
            path: "/shingle",
            name: "shingle",
            component: shingle
        },
        {
            path: "/records",
            name: "records",
            component: records
        },
        {
            path: "/Table_fortwo",
            name: "Table_fortwo",
            component: Table_fortwo
        },
        {
            path: "/Table_forthree",
            name: "Table_forthree",
            component: Table_forthree
        },
        {
            path: "/aptitude",
            name: "aptitude",
            component: aptitude
        },
        {
            path: "/audit",
            name: "audit",
            component: audit
        },
        {
            path: "/zaohui",
            name: "zaohui",
            component: zaohui
        },
        {
            path: "/toPay",
            name: "toPay",
            component: toPay
        },
        {
            path: "/productAll",
            name: "productAll",
            component: productAll,
            meta: {
                // keepAlive: true
            },
        },
        {
            path: "/product3",
            name: "product3",
            component: product3
        },
        {
            path: "/set_phonenew",
            name: "set_phonenew",
            component: set_phonenew
        },
        {
            path: "/editBj",
            name: "editBj",
            component: editBj
        },
        {
            path: "/shopaccountsCar",
            name: "shopaccountsCar",
            component: shopaccountsCar
        },
        {
            path: "/sweepPay",
            name: "sweepPay",
            component: sweepPay
        }

    ],
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            if (from.meta.keepAlive) {
                from.meta.savedPosition = document.body.scrollTop
            }
            return { x: 0, y: to.meta.savedPosition || 0 }
        }
    }
})